#ifndef SDL_GAMEPAD_H
#define SDL_GAMEPAD_H

#include "consts.h"
#include <SDL/SDL.h>

class SDL_GAMEPAD : public QThread
{
    Q_OBJECT

private:
    SDL_Joystick *joystick;
    SDL_Event event;

    int timer_id;

    bool axis_activated;
    bool axis_left_act;
    bool axis_right_act;

public:
    SDL_GAMEPAD(QObject *parent);
    ~SDL_GAMEPAD();


    void run();
    void timerEvent(QTimerEvent *);

signals:
    void signal_gamepad_clicked(GAMEPAD_ACTION);
    void signal_gamepad_released(GAMEPAD_ACTION);

};

#endif // SDL_GAMEPAD_H
